Problem Note 58957: The EXCHANGE statement in PROC DATASETS might incorrectly exchange twice in SAS® 9.3 or higher (English with DBCS)
The EXCHANGE statement in PROC DATASETS might incorrectly process the exchange a second time in SAS 9.3 or higher (English with DBCS). This is most likely to occur when multiple data sets with similar names exist in the library. The SAS log displays two notes reporting the exchange. The data sets appear as if they had never been exchanged. This problem does not occur in SAS 9.3 or higher (English) or SAS® (Unicode Support).
The sample code on the Full Code tab replicates the problem. The output that is generated by the sample code is shown on the Results tab.
To circumvent the problem, do one of the following:
- Remove the data sets with similar names from the library.
- Move the two data sets whose names you want to exchange into their own library to perform the exchange.
Operating System and Release Information
SAS System | Base SAS | HP-UX IPF | 9.3 TS1M0 | 9.4 TS1M4 |
64-bit Enabled Solaris | 9.3 TS1M0 | 9.4 TS1M4 |
64-bit Enabled HP-UX | 9.3 TS1M0 | 9.4 TS1M4 |
64-bit Enabled AIX | 9.3 TS1M0 | 9.4 TS1M4 |
Windows Vista for x64 | 9.3 TS1M0 | |
Windows Vista | 9.3 TS1M0 | |
Windows 7 Ultimate x64 | 9.3 TS1M0 | 9.4 TS1M4 |
Windows 7 Ultimate 32 bit | 9.3 TS1M0 | 9.4 TS1M4 |
Windows 7 Professional x64 | 9.3 TS1M0 | 9.4 TS1M4 |
Windows 7 Professional 32 bit | 9.3 TS1M0 | 9.4 TS1M4 |
Windows 7 Home Premium x64 | 9.3 TS1M0 | 9.4 TS1M4 |
Windows 7 Home Premium 32 bit | 9.3 TS1M0 | 9.4 TS1M4 |
Windows 7 Enterprise x64 | 9.3 TS1M0 | 9.4 TS1M4 |
Windows 7 Enterprise 32 bit | 9.3 TS1M0 | 9.4 TS1M4 |
Microsoft Windows XP Professional | 9.3 TS1M0 | |
Microsoft Windows Server 2008 for x64 | 9.3 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2008 R2 | 9.3 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2008 | 9.3 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2003 for x64 | 9.3 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.3 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.3 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.3 TS1M0 | |
Microsoft® Windows® for x64 | 9.3 TS1M0 | 9.4 TS1M4 |
z/OS 64-bit | 9.3 TS1M0 | 9.4 TS1M4 |
z/OS | 9.3 TS1M0 | 9.4 TS1M4 |
Linux | 9.3 TS1M0 | 9.4 TS1M4 |
Linux for x64 | 9.3 TS1M0 | 9.4 TS1M4 |
Solaris for x64 | 9.3 TS1M0 | 9.4 TS1M4 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
When multiple data sets with similar names exist in a library, the EXCHANGE statement in PROC DATASETS incorrectly processes the exchange a second time. This causes the data sets to appear as before. The sample code below replicates the issue.
data mytest;
x=1;
run;
data mytestt;
y=2;
run;
data mytesttt;
z=3;
run;
proc datasets nolist;
exchange mytest=mytestt;
run;
quit;
proc print data=mytest;
title 'mytest';
run;
proc print data=mytestt;
title 'mytestt';
run;
SAS (English with DBCS) output after the EXCHANGE statement. Data appears as it did before the exchange.
The note appears twice in the SAS log.
mytest mytestt
Obs x Obs x
1 1 1 2
NOTE: Exchanging the names WORK.MYTEST and WORK.MYTESTT (memtype=DATA).
NOTE: Exchanging the names WORK.MYTEST and WORK.MYTESTT (memtype=DATA).
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds
SAS (English) shows that data set names have been exchanged. Only one note appears in the SAS log.
mytest mytestt
Obs y Obs x
1 2 1 1
NOTE: Exchanging the names WORK.MYTEST and WORK.MYTESTT (memtype=DATA).
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
When multiple data sets with similar names exist in a library, the EXCHANGE statement of PROC DATASETS incorrectly processes the exchange a second time. This causes the data sets to appear unchanged.
Type: | Problem Note |
Priority: | high |
Date Modified: | 2016-09-12 15:14:05 |
Date Created: | 2016-09-09 16:01:26 |